package main

import (
	"fmt"
	"time"
)

func main() {
	//dingo.InitViper("./configs/adm.yaml")
	//dbs.NewMysqlComponent().Step()
	//
	//
	////logic.NewSyncLogic().DotaskUsers(1,"/Volumes/zhang/dev-zhongman/yunman-api/data/users/sc_user_20210628152706")
	////
	////logic.NewSyncLogic().DotaskPlaceRules(10, 20000, "/Volumes/zhang/dev-zhongman/记录/任务/易充迁移数据/网点价格表.json")
	////logic.NewSyncLogic().DotaskPlaceRules(12, 20000, "/Volumes/zhang/dev-zhongman/记录/任务/易充迁移数据/网点价格-套餐.json")
	////logic.NewSyncLogic().DotaskPlaceRules(10, 30000, "/Volumes/zhang/dev-zhongman/记录/任务/中曼迁移数据/网点价格.json")
	////logic.NewSyncLogic().DotaskPlaceRules(12, 30000, "/Volumes/zhang/dev-zhongman/记录/任务/中曼迁移数据/网点价格-套餐.json")
	//
	////logic.NewSyncLogic().DotaskRemoveUser()
	//logic.NewSyncLogic().DotaskRemoveUserUpdate(1)
	taskMessageIds := []int{1, 2, 3}
	taskMessageIds = append(taskMessageIds, 4)
	taskMessageIds = taskMessageIds[:len(taskMessageIds)-1]
	taskMessageIds = taskMessageIds[:len(taskMessageIds)-1]
	taskMessageIds = taskMessageIds[:len(taskMessageIds)-1]
	//taskMessageIds = taskMessageIds[:len(taskMessageIds)-1]
	fmt.Println(taskMessageIds)

	t := time.Unix(1623110404, 0).Format("2006-01-02")
	fmt.Println(t)

	startTime := "2021-07-01"
	endTime := "2021-07-31"
	dayTime := 60 * 60 * 24
	dayList := []string{}
	timeOff := true
	t1, _ := time.ParseInLocation("2006-01-02", startTime, time.Local)
	t2, _ := time.ParseInLocation("2006-01-02", endTime, time.Local)

	for timeOff {
		targetT := time.Unix(t1.Unix()+int64(dayTime*len(dayList)), 0)
		if targetT.Unix() <= t2.Unix() {
			dayList = append(dayList, targetT.Format("2006-01-02"))
		} else {
			timeOff = false
		}
	}

	fmt.Println(len(dayList))
	fmt.Println(dayList)
	fmt.Println(t1.Unix())
	fmt.Println(t2.Unix())
}
